home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  3.9 KB  |  153 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __TOOLUTILS__
  21. #define __TOOLUTILS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <QuickdrawText.h>                                    */
  34.  
  35. #ifndef __OSUTILS__
  36. #include <OSUtils.h>
  37. #endif
  38. /*    #include <Memory.h>                                            */
  39.  
  40. #ifndef __TEXTUTILS__
  41. #include <TextUtils.h>
  42. #endif
  43. /*    #include <Script.h>                                            */
  44. /*        #include <IntlResources.h>                                */
  45. /*        #include <Events.h>                                        */
  46.  
  47. #ifndef __FIXMATH__
  48. #include <FixMath.h>
  49. #endif
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. #if PRAGMA_ALIGN_SUPPORTED
  56. #pragma options align=mac68k
  57. #endif
  58.  
  59. #if PRAGMA_IMPORT_SUPPORTED
  60. #pragma import on
  61. #endif
  62.  
  63.  
  64. enum {
  65.     sysPatListID                = 0,
  66.     iBeamCursor                    = 1,
  67.     crossCursor                    = 2,
  68.     plusCursor                    = 3,
  69.     watchCursor                    = 4
  70. };
  71.  
  72. struct Int64Bit {
  73.     long                            hiLong;
  74.     unsigned long                    loLong;
  75. };
  76. typedef struct Int64Bit Int64Bit;
  77.  
  78. extern pascal Fixed FixRatio(short numer, short denom)
  79.  ONEWORDINLINE(0xA869);
  80. extern pascal Fixed FixMul(Fixed a, Fixed b)
  81.  ONEWORDINLINE(0xA868);
  82. extern pascal short FixRound(Fixed x)
  83.  ONEWORDINLINE(0xA86C);
  84. extern pascal void PackBits(Ptr *srcPtr, Ptr *dstPtr, short srcBytes)
  85.  ONEWORDINLINE(0xA8CF);
  86. extern pascal void UnpackBits(Ptr *srcPtr, Ptr *dstPtr, short dstBytes)
  87.  ONEWORDINLINE(0xA8D0);
  88. extern pascal Boolean BitTst(const void *bytePtr, long bitNum)
  89.  ONEWORDINLINE(0xA85D);
  90. extern pascal void BitSet(void *bytePtr, long bitNum)
  91.  ONEWORDINLINE(0xA85E);
  92. extern pascal void BitClr(void *bytePtr, long bitNum)
  93.  ONEWORDINLINE(0xA85F);
  94. extern pascal long BitAnd(long value1, long value2)
  95.  ONEWORDINLINE(0xA858);
  96. extern pascal long BitOr(long value1, long value2)
  97.  ONEWORDINLINE(0xA85B);
  98. extern pascal long BitXor(long value1, long value2)
  99.  ONEWORDINLINE(0xA859);
  100. extern pascal long BitNot(long value)
  101.  ONEWORDINLINE(0xA85A);
  102. extern pascal long BitShift(long value, short count)
  103.  ONEWORDINLINE(0xA85C);
  104. #if GENERATING68K
  105. extern pascal void LongMul(long a, long b, Int64Bit *result)
  106.  ONEWORDINLINE(0xA867);
  107. #else
  108. #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  109. #endif
  110. #if OLDROUTINELOCATIONS
  111. extern pascal Handle GetIcon(short iconID)
  112.  ONEWORDINLINE(0xA9BB);
  113. extern pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  114.  ONEWORDINLINE(0xA94B);
  115. #endif
  116. extern pascal PatHandle GetPattern(short patternID)
  117.  ONEWORDINLINE(0xA9B8);
  118. extern pascal CursHandle GetCursor(short cursorID)
  119.  ONEWORDINLINE(0xA9B9);
  120. extern pascal PicHandle GetPicture(short pictureID)
  121.  ONEWORDINLINE(0xA9BC);
  122. extern pascal Fixed SlopeFromAngle(short angle)
  123.  ONEWORDINLINE(0xA8BC);
  124. extern pascal short AngleFromSlope(Fixed slope)
  125.  ONEWORDINLINE(0xA8C4);
  126. extern pascal long DeltaPoint(Point ptA, Point ptB)
  127.  ONEWORDINLINE(0xA94F);
  128. extern pascal void ShieldCursor(const Rect *shieldRect, Point offsetPt)
  129.  ONEWORDINLINE(0xA855);
  130. extern pascal void ScreenRes(short *scrnHRes, short *scrnVRes)
  131.  SIXWORDINLINE(0x225F, 0x32B8, 0x0102, 0x225F, 0x32B8, 0x0104);
  132. extern pascal void GetIndPattern(Pattern *thePat, short patternListID, short index);
  133. #if CGLUESUPPORTED
  134. extern void shieldcursor(const Rect *shieldRect, Point *offsetPt);
  135. extern long deltapoint(Point *ptA, Point *ptB);
  136. #endif
  137. #define HiWord(x) ((short)((long)(x) >> 16))
  138. #define LoWord(x) ((short)(x))
  139.  
  140. #if PRAGMA_IMPORT_SUPPORTED
  141. #pragma import off
  142. #endif
  143.  
  144. #if PRAGMA_ALIGN_SUPPORTED
  145. #pragma options align=reset
  146. #endif
  147.  
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151.  
  152. #endif /* __TOOLUTILS__ */
  153.